﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Liolikas.GameMenu
{
    class MenuIterator
    {
        private List<MenuSection> menuSections;
        int index;
        public MenuIterator(List<MenuSection> menuSections)
        {
            index = 0;
            this.menuSections = menuSections;
        }

        public void Next(){ 
            index++;
            if (index >= menuSections.Count) index = 0;
         }

        public void Prev()
        {
            index--;
            if (index < 0) index = menuSections.Count - 1;
        }

        public MenuSection GetCur()
        {
            return menuSections[index];
        }
    }
}
